package guan.bean;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Transient;

import net.sf.autodao.PersistentEntity;

@Entity
@IdClass(ResCodePK.class)
public class ResCode implements PersistentEntity<ResCodePK> {
	private String name;
	@Id
	private String value;
	@Id
	private ResCodeType resCodeType;
	@Transient
	private Long resCodeTypeId;

	@Override
	public ResCodePK getPrimaryKey() {
		return new ResCodePK(value, resCodeType);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public ResCodeType getResCodeType() {
		return resCodeType;
	}

	public void setResCodeType(ResCodeType resCodeType) {
		this.resCodeType = resCodeType;
	}

	public Long getResCodeTypeId() {
		return this.getResCodeType().getId();
	}

	public void setResCodeTypeId(Long resCodeTypeId) {
		this.resCodeTypeId = resCodeTypeId;
	}

}
